import { useState } from "react"

function listTab(props){
    let [onid,setOnid]=useState(1)
    let {cof}=props
    let aaa=(id)=>{
        setOnid(id)
        props.huo(id)
    }
    return (
        <>
           {
     cof.map(ite=>{
        return <span key={ite.id} 
        style={{display:'inline-block',border:'1px solid #ccc',padding:'10px 20px',marginLeft:'20px'}} 
        onClick={()=>aaa(ite.id)} 
        className={onid==ite.id?'active':''}
        
        >{ite.type}</span>
      })
    }  
        </>
    )
}
export default listTab